package com.alibaba.nacos.config.server.jpa.repository;

import com.alibaba.nacos.config.server.jpa.entity.PermissionsEntity;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.stereotype.Repository;

/**
 * The type of nacos-all.
 *
 * @author 问道于盲
 * @date 2020-03-12
 */
@Repository
public interface PermissionsRepository extends BaseRepository<PermissionsEntity, Long> {

    @Modifying
    void deleteByRoleAndActionAndResource(String role, String action, String resource);

    Page<PermissionsEntity> findByRole(String role, Pageable pageable);
}
